//
//  CZCommentContent.swift
//  GZWeibo666
//
//  Created by Apple on 15/12/3.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit

class CZCommentContent: NSObject {
    var created_at : String?
    var text : String?
    
    init(dict: [String: AnyObject]) {
      super.init()
        
        setValuesForKeysWithDictionary(dict)
    }
    
   class func loadCommtnes(id : Int?, count: Int?, finished : (modelArr : [CZCommentContent])->Void) {
    
        CZNetworkTool.sharedInstance.getCommentList(id, count: count) { (result , error) -> () in
            if let array = result?["comments"] as? [[String: AnyObject]] {
                var commentArray = [CZCommentContent]()
                for dict in array {
                    let comment = CZCommentContent(dict: dict)
                    commentArray.append(comment)
                }
                print("获取评论完成")
                finished(modelArr: commentArray)
            }
        }
    }
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    
}
